<template>
	<view>
		<button @click='onAuthLocation' >授权并获取位置</button>
		
		<view>经纬度：{{location}}</view>
	</view>
</template>

<script>
	import {location} from '@/utils/location.js'
	import {mapState} from 'vuex'
	export default {
		components:{},
		computed:{
			...mapState(['location'])//获取store仓库参数
		},
		data(){
			return{
	
			}
		},
		methods:{
			onAuthLocation(){
				location(true)//调用utils中方法
			}

		}
	}
</script>

<style scoped>

</style>